<html lang="en" xmlns:th="http://www.thymeleaf.org">
<nav class="nav" th:fragment="navbar">
    <div class="pure-menu pure-menu-horizontal" style="text-align: left;margin-left: 10%">
        <li class="pure-menu-item pure-menu-selected" style="margin-left: 0%"><a href="/" class="pure-menu-link">首页</a></li>
        <li th:if="${session.user.role == 2}" class="pure-menu-item" style="margin-left: 5%"><a href="/modelList" class="pure-menu-link">教学管理</a></li>
        <li th:if="${session.user.role == 1}" class="pure-menu-item" style="margin-left: 5%"><a href="/admin/userList" class="pure-menu-link">后台管理</a></li>
        <li th:if="${session.user.role == 3}" class="pure-menu-item" style="margin-left: 5%"><a href="/student/myLearn" class="pure-menu-link">我的学习</a></li>

        <li class="pure-menu-item" style="margin-left: 5%"><a href="/myInfo" class="pure-menu-link">个人中心</a></li>
        <li class="pure-menu-item" style="margin-left: 5%"><a href="/news" class="pure-menu-link">更多</a></li>
        <li class="pure-menu-item" style="margin-left: 5%">
            <a th:if="${session.user.role == 1}"  href="/myInfo" class="pure-menu-link" style="color:orange;" th:text="'你好，管理员'+ ${session.user.name}"></a>
            <a th:if="${session.user.role == 2}" href="/myInfo" class="pure-menu-link" style="color:orange;" th:text="'你好，教师'+ ${session.user.name}"></a>
            <a th:if="${session.user.role == 3}" href="/myInfo" class="pure-menu-link" style="color:orange;" th:text="'你好，学生'+ ${session.user.name}"></a>
        </li>
        <li class="pure-menu-item" style="margin-left: 15%"><a href="/loginOut" class="pure-menu-link">退出</a></li>
    </div>
</nav>

<nav class="nav" th:fragment="navbarUnLogin">
    <div class="pure-menu pure-menu-horizontal" style="text-align: left;margin-left: 10%">
        <li class="pure-menu-item pure-menu-selected" style="margin-left: 0%"><a href="/" class="pure-menu-link">首页</a></li>
        <li class="pure-menu-item" style="margin-left: 5%"><a href="/news" class="pure-menu-link">新闻资讯</a></li>
        <li class="pure-menu-item" style="margin-left: 5%"><a href="/about" class="pure-menu-link">联系我们</a></li>
        <li class="pure-menu-item" style="margin-left: 15%">
            <a href="/login" class="pure-menu-link" style="color: #2a80eb" >已有账号，登录|</a>
        </li>
        <li class="pure-menu-item" style="margin-left: 0%">
            <a href="/register" class="pure-menu-link">注册|</a>
        </li>
    </div>
</nav>

<header class="box" th:fragment="boxbar">
    <p  th:if="${session.user.role == 1}">超级管理员</p>
    <p  th:if="${session.user.role == 2}">教师</p>
    <p  th:if="${session.user.role == 3}">学生</p>
    <p th:if="${session.user.role == 1}">用户总数 33 |  模块总数  2</p>
    <p th:if="${session.user.role == 2 }">课程总数 2 | 班级总数 2 | 进行中的课程 1|已完成的课程 1</p>
    <p th:if="${session.user.role == 3}"> 课程总数：<a th:text="${num}"></a></p>
</header>